package com.mango.module.base.listenner;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.mango.module.base.job.LdapDepartTask;
import com.mango.module.base.job.LdapUserTask;

/**
 * 加载定时任务
 * @author Mango-Lab
 * @Date 2021年4月8日
 */
@Component
@Order(value = 1)
public class ParamsInitListener implements CommandLineRunner {

	private Logger logger = LoggerFactory.getLogger(getClass());

	@Override
	public void run(String... arg0) throws Exception {
		try {
			logger.info("初识化定时任务>>>");
			new LdapDepartTask();
			new LdapUserTask();
			logger.info("<<<初识化定时任务");
		} catch (Exception e) {
			logger.error("-------定时任务 启动失败----------", e);
		}

	}
}